module.exports = {
    state: {
        salary: {}
    },
    mutations: {
        salary (state, data) {
            state.salary = {
                list: data
            }
        }
    },
    actions: {
        getSalary ({commit, state}, resolve) {
            uid = $store.getters.userID
            $store.api.call('salary_list', {
                message: '获取工资单失败',
                form: {id: uid}
            }, ({data}) => {
                commit('salary', data)
                if(resolve && resolve.call) {
                    resolve(data)
                }
            })
        }
    },
    getters: {
        salaryList (state) {
            return state.salary
        }
    }
}